\(\int \cos (a+\sqrt {-\frac {1}{n^2}} \log (c x^n)) \, dx\) [105]

   Optimal result
   Rubi [A] (verified)
   Mathematica [F]
   Maple [F]
   Fricas [C] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 62 \[ \int \cos \left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right ) \, dx=\frac {1}{4} e^{-a \sqrt {-\frac {1}{n^2}} n} x \left (c x^n\right )^{\frac {1}{n}}+\frac {1}{2} e^{a \sqrt {-\frac {1}{n^2}} n} x \left (c x^n\right )^{-1/n} \log (x) \]

[Out]

1/4*x*(c*x^n)^(1/n)/exp(a*n*(-1/n^2)^(1/2))+1/2*exp(a*n*(-1/n^2)^(1/2))*x*ln(x)/((c*x^n)^(1/n))

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {4572, 4578} \[ \int \cos \left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right ) \, dx=\frac {1}{4} x e^{-a \sqrt {-\frac {1}{n^2}} n} \left (c x^n\right )^{\frac {1}{n}}+\frac {1}{2} x e^{a \sqrt {-\frac {1}{n^2}} n} \log (x) \left (c x^n\right )^{-1/n} \]

[In]

Int[Cos[a + Sqrt[-n^(-2)]*Log[c*x^n]],x]

[Out]

(x*(c*x^n)^n^(-1))/(4*E^(a*Sqrt[-n^(-2)]*n)) + (E^(a*Sqrt[-n^(-2)]*n)*x*Log[x])/(2*(c*x^n)^n^(-1))

Rule 4572

Int[Cos[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Dist[x/(n*(c*x^n)^(1/n)), Subst[Int[x
^(1/n - 1)*Cos[d*(a + b*Log[x])]^p, x], x, c*x^n], x] /; FreeQ[{a, b, c, d, n, p}, x] && (NeQ[c, 1] || NeQ[n,
1])

Rule 4578

Int[Cos[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Dist[1/2^p, Int[ExpandIntegrand[
(e*x)^m*(E^(a*b*d^2*(p/(m + 1)))/x^((m + 1)/p) + x^((m + 1)/p)/E^(a*b*d^2*(p/(m + 1))))^p, x], x], x] /; FreeQ
[{a, b, d, e, m}, x] && IGtQ[p, 0] && EqQ[b^2*d^2*p^2 + (m + 1)^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\left (x \left (c x^n\right )^{-1/n}\right ) \text {Subst}\left (\int x^{-1+\frac {1}{n}} \cos \left (a+\sqrt {-\frac {1}{n^2}} \log (x)\right ) \, dx,x,c x^n\right )}{n} \\ & = \frac {\left (x \left (c x^n\right )^{-1/n}\right ) \text {Subst}\left (\int \left (\frac {e^{a \sqrt {-\frac {1}{n^2}} n}}{x}+e^{-a \sqrt {-\frac {1}{n^2}} n} x^{-1+\frac {2}{n}}\right ) \, dx,x,c x^n\right )}{2 n} \\ & = \frac {1}{4} e^{-a \sqrt {-\frac {1}{n^2}} n} x \left (c x^n\right )^{\frac {1}{n}}+\frac {1}{2} e^{a \sqrt {-\frac {1}{n^2}} n} x \left (c x^n\right )^{-1/n} \log (x) \\ \end{align*}

Mathematica [F]

\[ \int \cos \left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right ) \, dx=\int \cos \left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right ) \, dx \]

[In]

Integrate[Cos[a + Sqrt[-n^(-2)]*Log[c*x^n]],x]

[Out]

Integrate[Cos[a + Sqrt[-n^(-2)]*Log[c*x^n]], x]

Maple [F]

\[\int \cos \left (a +\ln \left (c \,x^{n}\right ) \sqrt {-\frac {1}{n^{2}}}\right )d x\]

[In]

int(cos(a+ln(c*x^n)*(-1/n^2)^(1/2)),x)

[Out]

int(cos(a+ln(c*x^n)*(-1/n^2)^(1/2)),x)

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.24 (sec) , antiderivative size = 40, normalized size of antiderivative = 0.65 \[ \int \cos \left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right ) \, dx=\frac {1}{4} \, {\left (x^{2} + 2 \, e^{\left (\frac {2 \, {\left (i \, a n - \log \left (c\right )\right )}}{n}\right )} \log \left (x\right )\right )} e^{\left (-\frac {i \, a n - \log \left (c\right )}{n}\right )} \]

[In]

integrate(cos(a+log(c*x^n)*(-1/n^2)^(1/2)),x, algorithm="fricas")

[Out]

1/4*(x^2 + 2*e^(2*(I*a*n - log(c))/n)*log(x))*e^(-(I*a*n - log(c))/n)

Sympy [F]

\[ \int \cos \left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right ) \, dx=\int \cos {\left (a + \sqrt {- \frac {1}{n^{2}}} \log {\left (c x^{n} \right )} \right )}\, dx \]

[In]

integrate(cos(a+ln(c*x**n)*(-1/n**2)**(1/2)),x)

[Out]

Integral(cos(a + sqrt(-1/n**2)*log(c*x**n)), x)

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.47 \[ \int \cos \left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right ) \, dx=\frac {c^{\frac {2}{n}} x^{2} \cos \left (a\right ) + 2 \, \cos \left (a\right ) \log \left (x\right )}{4 \, c^{\left (\frac {1}{n}\right )}} \]

[In]

integrate(cos(a+log(c*x^n)*(-1/n^2)^(1/2)),x, algorithm="maxima")

[Out]

1/4*(c^(2/n)*x^2*cos(a) + 2*cos(a)*log(x))/c^(1/n)

Giac [A] (verification not implemented)

none

Time = 0.35 (sec) , antiderivative size = 1, normalized size of antiderivative = 0.02 \[ \int \cos \left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right ) \, dx=+\infty \]

[In]

integrate(cos(a+log(c*x^n)*(-1/n^2)^(1/2)),x, algorithm="giac")

[Out]

+Infinity

Mupad [B] (verification not implemented)

Time = 28.80 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.34 \[ \int \cos \left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right ) \, dx=\frac {x\,{\mathrm {e}}^{-a\,1{}\mathrm {i}}\,\frac {1}{{\left (c\,x^n\right )}^{\sqrt {-\frac {1}{n^2}}\,1{}\mathrm {i}}}\,1{}\mathrm {i}}{2\,n\,\sqrt {-\frac {1}{n^2}}+2{}\mathrm {i}}-\frac {x\,{\mathrm {e}}^{a\,1{}\mathrm {i}}\,{\left (c\,x^n\right )}^{\sqrt {-\frac {1}{n^2}}\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2\,n\,\sqrt {-\frac {1}{n^2}}-2{}\mathrm {i}} \]

[In]

int(cos(a + log(c*x^n)*(-1/n^2)^(1/2)),x)

[Out]

(x*exp(-a*1i)/(c*x^n)^((-1/n^2)^(1/2)*1i)*1i)/(2*n*(-1/n^2)^(1/2) + 2i) - (x*exp(a*1i)*(c*x^n)^((-1/n^2)^(1/2)
*1i)*1i)/(2*n*(-1/n^2)^(1/2) - 2i)